//
//  TTMusicBaseTableView.m
//  TTMusic
//
//  Created by chenpengyu on 16/3/30.
//  Copyright © 2016年 cpy. All rights reserved.
//

#import "TTMusicBaseTableView.h"

@implementation TTMusicBaseTableView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

-(instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
    
    self = [super initWithFrame:frame style:style];
    
    if (self) {
        
        NSString *states = [[NSUserDefaults standardUserDefaults]objectForKey:@"night"];
        if ([states isEqualToString:@"yes"]) {
            self.backgroundColor = [UIColor blackColor];
        }else {
            
            self.backgroundColor = [UIColor whiteColor];
        }
        
        
    }
    [[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(changColor:) name:@"changColor" object:nil];
    
    return self;
    
}

-(void)changColor:(NSNotification *)notifiction {
    
    UIColor *color = [notifiction object];
    
    self.backgroundColor = color;
    
    
}



@end
